package com.library.controller;

import com.library.entity.OaAttendanceRecord;
import com.library.entity.OaAttendanceRecordExt;
import com.library.entity.OaAttendanceRecordReq;
import com.library.entity.OaAttendanceRecordStaticVo;
import com.library.service.OaAttendanceRecordServiceImpl;
import com.library.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ido
 * @since 2024-12-14
 */
@Controller
public class OaAttendanceRecordStaticsController {

    public static final String prefix = "/api/oaAttendanceRecordStatics";

    @Autowired
    private OaAttendanceRecordServiceImpl oaAttendanceRecordService;

    @RequestMapping("/oaAttendanceRecordStatics.html")
    public ModelAndView adminBooks() {
        ModelAndView modelAndView = new ModelAndView("oaAttendanceRecordStatics");
        return modelAndView;
    }

    @RequestMapping(path = prefix + "/statics",
            method = RequestMethod.POST
    )
    @ResponseBody
    public BaseResult statics(@RequestBody OaAttendanceRecordExt oaDepartmentUserLink) {
        List<OaAttendanceRecordStaticVo> list = this.oaAttendanceRecordService.statics(oaDepartmentUserLink);
        return BaseResult.successWithData(list);
    }

}
